Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

gh-144140: Optimize len for frozen dict/set constants in optimizer#149969

Merged
kumaraditya303 merged 1 commit into
python:mainfrom
lgeiger:frozen-set-dict-len
May 18, 2026
Merged

gh-144140: Optimize len for frozen dict/set constants in optimizer#149969
kumaraditya303 merged 1 commit into
python:mainfrom
lgeiger:frozen-set-dict-len

Conversation

@lgeiger
Copy link
Copy Markdown
Contributor

@lgeiger lgeiger commented May 18, 2026

This PR extends #144142 to also handle frozenset and frozendict. Let me know if you think this optimization is not worth it, but it doesn't complicated the code so I don't see any downsides in adding it.

"PyStackRef_RefcountOnObject",
"PyStackRef_TYPE",
"PyStackRef_True",
"PyBytes_GET_SIZE",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell #144142 missed adding PyBytes_GET_SIZE to NON_ESCAPING_FUNCTIONS

@kumaraditya303 kumaraditya303 merged commit 18281db into python:main May 18, 2026
129 of 131 checks passed
@lgeiger lgeiger deleted the frozen-set-dict-len branch May 18, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants